-- @Author:pandayu
-- @Version:1.0
-- @DateTime:2018-09-09
-- @Project:pandaCardServer CardGame
-- @Contact: QQ:815099602
local roleMgr = require "manager.roleMgr"

local _M = function(role,data)
	if not data.id or type(data.id) ~= "number" then return 2 end
	if not data.typ or type(data.typ) ~= "number" then return 2 end
	if data.typ ~= 1 and data.typ ~= 2 then return 1901 end
	local list = {}
	if data.typ == 1 then list = role.boss:can_get_one_explot(data.id)
	elseif data.typ == 2 then  list = role.boss:can_get_all_explot() end
	if not list or #list == 0 then return 1904 end
	local profit = role.boss:get_explot(list)
	role:gain_resource(profit)
	return 0,{data = profit}
end
return _M
